package com.instwall.callnum.basecomponent;

import com.instwall.callbase.MConfig;

import java.lang.reflect.Field;

public class CallNumBaseComponent {

    /**
     * @return BuildConfig "mode" Value
     */
    public static Object getBuildConfigFieldValue(String fieldName) {
        try {
            Class<?> clazz = Class.forName(MConfig.mGlobalContext.getPackageName() + ".BuildConfig");
            Field field = clazz.getField(fieldName);
            return field.get(null);
        } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
